package com.hnkywl.sts.entity.sys;

import com.hnkywl.sts.entity.BaseEntity;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.util.List;

/**
 * 角色
 * Created with IntelliJ IDEA.
 * User: jerry
 * Date: 13-3-3
 * Time: 下午10:13
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name="T_SYS_JS")
@Where(clause = "deleted!='1'")
public class Js extends BaseEntity {
    @Id
    @SequenceGenerator(name = "seqJs", allocationSize = 1, sequenceName = "SEQ_SYS_JS")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seqJs")
    private Long id;
    /**
    * 名称
    */
    private String mc;
    /**
     * 备注
     */
    private String remarks;
    /**
    * 岗位
    */
    @ManyToMany(fetch = FetchType.LAZY,mappedBy = "jsList")
    private List<Gw> gwList;
    /**
    * 权限列表
    */
    @ManyToMany(fetch = FetchType.LAZY)
    @JoinTable(name="T_SYS_JS_QX", joinColumns={@JoinColumn(name="JS_ID")},inverseJoinColumns={@JoinColumn(name="QX_ID")})
    @Where(clause = "deleted!='1'")
    private List<Qx> qxList;
    /**
     * 人员列表
     */
    @ManyToMany(fetch = FetchType.LAZY,mappedBy = "jsList")
    private List<Yg> ygList;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getMc() {
        return mc;
    }

    public void setMc(String mc) {
        this.mc = mc;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public List<Gw> getGwList() {
        return gwList;
    }

    public void setGwList(List<Gw> gwList) {
        this.gwList = gwList;
    }

    public List<Qx> getQxList() {
        return qxList;
    }

    public void setQxList(List<Qx> qxList) {
        this.qxList = qxList;
    }

    public List<Yg> getYgList() {
        return ygList;
    }

    public void setYgList(List<Yg> ygList) {
        this.ygList = ygList;
    }

}
